<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" >
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>Title</title>
    <!-- JS -->
    <script type="text/javascript" th:src="@{/myconfig/bootstrap/js/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/myconfig/bootstrap/js/bootstrap.min.js}"></script>

    <!-- CSS -->
    <link th:href="@{/myconfig/bootstrap/css/bootstrap.min.css}" type="text/css" rel="stylesheet" media="all">
    <link rel="stylesheet" th:href="@{/myconfig/layui/css/layui.css}" media="all">
    <style>
        body {
            margin: 10px;
        }

        .demo-carousel {
            height: 200px;
            line-height: 200px;
            text-align: center;
        }
    </style>
</head>
<body>
<div class="layui-form-item">
    <label class="layui-form-label" style="width: 200px">工作计划发布者</label>
    <div class="layui-input-block">
        <label class="layui-form-label" style="width: 200px" id="planFounderId"></label>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label" style="width: 200px">工作计划发布时间</label>
    <div class="layui-input-block">
        <label class="layui-form-label" id="planTime" style="width: 200px"></label>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label" style="width: 200px">工作计划类型</label>
    <div class="layui-input-block">
        <label class="layui-form-label" style="width: 200px" id="planType"></label>
    </div>
</div>
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label" style="width: 200px">计划内容</label>
    <div class="layui-input-block">
        <textarea placeholder="请输入计划内容" class="layui-textarea" style="height: 350px" name="planContent"
                  id="planContent" disabled></textarea>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label" style="width: 200px">开始时间</label>
    <div class="layui-input-block">
        <label class="layui-form-label" style="width: 200px" id="startTime"></label>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label" style="width: 200px">结束时间</label>
    <div class="layui-input-block">
        <label class="layui-form-label" style="width: 200px" id="endTime"></label>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <a href="work_plan.html" class="layui-btn">返回列表</a>
    </div>

</div>
<script th:src="@{/myconfig/layui/layui.js}"></script>
<script>
    function generateWord() {
        var planId = GetQueryString("planId");
        layui.use('table', function () {
            $.ajax({
                url: "plan/generate/file",
                type: "get",
                data: {
                    "planId": planId
                },
                success: function (result) {
                    alert(result);
                }
            })
        })
    }
</script>
<script>
    function queryPlanById2() {
        var planId = GetQueryString("planId")
        layui.use('table', function () {
            $.ajax({
                url: "plan/details",
                type: "get",
                data: {
                    "planId": planId
                },
                success: function (result) {
                    var data = result.data;
                    $("#planFounderId").text(data.userName);
                    $("#planType").text(data.planTypeName);
                    $("#planTime").text(data.planTime);
                    $("#planContent").text(data.planContent);
                    $("#startTime").text(data.planStartTime);
                    $("#endTime").text(data.planEndTime);
                }
            });
        })
    }

    //带着参数页面跳转
    queryPlanById2();

    //获取页面参数
    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);//search,查询？后面的参数，并匹配正则
        if (r != null) return unescape(r[2]);
        return null;
    }


</script>
</body>
</html>